﻿namespace ExamV5.GradeInfo
{
    using ExamV5;
    using System;
    using System.Configuration;
    using System.Data;
    using System.Data.SqlClient;
    using System.IO;
    using System.Text;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.HtmlControls;
    using System.Web.UI.WebControls;

    public class FrmGradeSortList : Page
    {
        protected Button butExp;
        protected Button butQuery;
        protected GridView DataGridInfo;
        protected DropDownList DDLDept;
        protected DropDownList DDLQuery;
        protected DropDownList DDLSubject;
        protected DropDownList DDLUPDept;
        private double double_0 = 0.0;
        private double double_1 = 0.0;
        protected HtmlForm Form1;
        protected HtmlHead Head1;
        private HttpCookie httpCookie_0 = null;
        private HttpCookie httpCookie_1 = null;
        private HttpCookie httpCookie_2 = null;
        private HttpCookie httpCookie_3 = null;
        protected Label labTip;
        private long long_0 = 0L;
        private PublicFun publicFun_0 = new PublicFun();
        protected ScriptManager SM;
        private string string_0 = "1";
        protected TextBox txtEndDate;
        protected TextBox txtQuery;
        protected TextBox txtStartDate;
        protected UpdatePanel UPPart;

        protected void butExp_Click(object sender, EventArgs e)
        {
            try
            {
                this.string_0 = "1";
                this.double_0 = 0.0;
                this.double_1 = 0.0;
                string cmdText = "";
                string path = base.Server.MapPath("../") + @"\PublicFile\GradeSortDataInfo" + this.httpCookie_3.Value + ".csv";
                string str3 = "";
                if (File.Exists(path))
                {
                    File.Delete(path);
                }
                StreamWriter writer = new StreamWriter(path, true, Encoding.GetEncoding("GB2312"));
                writer.WriteLine("准考证号,考生姓名,所属部门,所属职务,所属岗位,考试名称,考试科目,考试现得分,登陆IP,考试时间,考试用时,当前标识,排名");
                cmdText = "select  a.JoinDate,a.LastDate,a.LoginIP,d.ExamTime,datediff(s,convert(dateTime,a.StartTime),convert(dateTime,a.EndTime)) as ExamUseTime,a.StartTime,a.EndTime,b.Worker,b.UserGWName,b.UserName,c.UPID,c.DeptName,a.UserCode,a.PaperID,a.ExamName,a.Subject,ROUND(a.GetOldCountFen,2) as GetOldCountFen,ROUND(a.GetCountFen,2) as GetCountFen,Flag=case a.Flag when 'C' then '考试完成' when 'D' then '客观题批改完成' when 'E' then '考试批改完成' when 'G' then '考试异常'  when 'Z' then '作弊标记' end  from ExamUser a,UserInfo b,DeptInfo c,PaperInfo d where d.ID=a.PaperID and a.UserCode=b.UserCode and b.DeptID=c.ID and (a.Flag<>'A' and a.Flag<>'B') ";
                if (!(this.publicFun_0.GetValues("select ParmValue from SysParmInfo where ParmMemo='IsLookTestExam'", "ParmValue").Trim() == "Y"))
                {
                    cmdText = cmdText + " and  a.ExamType='A' ";
                }
                else
                {
                    cmdText = cmdText + " and  (a.ExamType='A' or a.ExamType='C') ";
                }
                if (this.DDLDept.SelectedItem.Value != "0")
                {
                    cmdText = cmdText + " and b.DeptID in (select b.ID from DeptInfo b where " + this.publicFun_0.GetManagDeptID(this.publicFun_0.CheckString(this.DDLDept.SelectedItem.Value)) + ")";
                }
                if (this.DDLSubject.SelectedIndex >= 0)
                {
                    if (this.DDLSubject.SelectedItem.Value == "0")
                    {
                        ScriptManager.RegisterStartupScript(this.UPPart, this.Page.GetType(), "BChoose", "alert('请选择考试科目信息！')", true);
                    }
                    cmdText = cmdText + " and a.Subject like '%" + this.publicFun_0.CheckString(this.DDLSubject.SelectedItem.Text.Replace("│", "").Replace("├", "")) + "%'";
                }
                if (this.txtQuery.Text.Trim() != "")
                {
                    cmdText = cmdText + " and " + this.publicFun_0.CheckString(this.DDLQuery.SelectedItem.Value) + " like '%" + this.publicFun_0.CheckString(this.txtQuery.Text) + "%'";
                }
                if (this.txtStartDate.Text.Trim() != "")
                {
                    cmdText = cmdText + " and Convert(dateTime,a.JoinDate)>=Convert(dateTime,'" + this.publicFun_0.CheckString(this.txtStartDate.Text.Trim()) + " 00:00:00')";
                }
                if (this.txtEndDate.Text.Trim() != "")
                {
                    cmdText = cmdText + " and Convert(dateTime,'" + this.publicFun_0.CheckString(this.txtEndDate.Text.Trim()) + " 23:59:59')>=Convert(dateTime,a.JoinDate)";
                }
                if (this.publicFun_0.GetValues("select ParmValue from SysParmInfo where ParmMemo='ManagGradeType'", "ParmValue").Trim().Trim() == "N")
                {
                    if (this.ViewState["ManagPower"].ToString() != "Y")
                    {
                        if (!(this.ViewState["AddPower"].ToString() == "Y"))
                        {
                            cmdText = cmdText + " and d.ID=0 ";
                        }
                        else
                        {
                            cmdText = cmdText + " and d.InputUserCode='" + this.httpCookie_0.Value + "'";
                        }
                    }
                    else
                    {
                        cmdText = cmdText + " and d.ID<>0 ";
                    }
                }
                cmdText = cmdText + "  order by " + this.ViewState["SortFiled"].ToString() + this.ViewState["SortType"].ToString() + ",datediff(s,convert(dateTime,a.StartTime),convert(dateTime,a.EndTime))";
                int num = 0;
                SqlConnection connection = new SqlConnection(ConfigurationManager.ConnectionStrings["Conn"].ConnectionString);
                connection.Open();
                SqlCommand command = new SqlCommand(cmdText, connection);
                SqlDataReader reader = command.ExecuteReader(CommandBehavior.CloseConnection);
                while (reader.Read())
                {
                    str3 = "";
                    str3 = (str3 + reader["UserCode"].ToString().Trim() + "\x00b7,") + reader["UserName"].ToString().Trim() + ",";
                    if (!(reader["UPID"].ToString().Trim() == "0"))
                    {
                        str3 = str3 + this.publicFun_0.GetValues("select DeptName from DeptInfo where ID=" + reader["UPID"].ToString().Trim(), "DeptName") + @"\" + reader["DeptName"].ToString().Trim() + ",";
                    }
                    else
                    {
                        str3 = str3 + reader["DeptName"].ToString().Trim() + ",";
                    }
                    str3 = (((((str3 + reader["Worker"].ToString().Trim() + ",") + reader["UserGWName"].ToString().Trim() + ",") + reader["ExamName"].ToString().Trim() + ",") + reader["Subject"].ToString().Trim() + ",") + reader["GetCountFen"].ToString().Trim() + ",") + reader["LoginIP"].ToString().Trim() + ",";
                    str3 = str3 + reader["JoinDate"].ToString().Trim() + " " + reader["StartTime"].ToString().Trim() + "---" + reader["LastDate"].ToString().Trim() + " " + reader["EndTime"].ToString().Trim() + ",";
                    int num2 = Convert.ToInt32(reader["ExamUseTime"].ToString().Trim());
                    if ((num2 < 0) || (num2 > (Convert.ToInt32(reader["ExamTime"].ToString().Trim()) * 60)))
                    {
                        str3 = str3 + Convert.ToString((int) (Convert.ToInt32(reader["ExamTime"].ToString()) * 60)) + "秒,";
                    }
                    else
                    {
                        str3 = str3 + reader["ExamUseTime"].ToString() + "秒,";
                    }
                    str3 = str3 + reader["Flag"].ToString().Trim() + ",";
                    if (reader["GetCountFen"].ToString().Trim() != "")
                    {
                        this.double_1 = Convert.ToDouble(reader["GetCountFen"].ToString().Trim());
                    }
                    else
                    {
                        this.double_1 = 0.0;
                    }
                    if (this.long_0 == 0L)
                    {
                        str3 = str3 + "1,";
                        this.string_0 = "1";
                        this.long_0 += 1L;
                    }
                    else
                    {
                        this.long_0 += 1L;
                        if ((this.ViewState["SumGradeSort"].ToString() == "N") ? !(this.double_0 == this.double_1) : true)
                        {
                            str3 = str3 + Convert.ToString((int) (Convert.ToInt16(this.string_0) + 1)) + ",";
                            this.string_0 = Convert.ToString((int) (Convert.ToInt16(this.string_0) + 1));
                        }
                        else
                        {
                            str3 = str3 + Convert.ToString(this.string_0) + ",";
                        }
                    }
                    this.double_0 = this.double_1;
                    writer.WriteLine(str3);
                    num++;
                }
                reader.Close();
                command.Dispose();
                connection.Close();
                connection.Dispose();
                writer.Flush();
                writer.Close();
                this.labTip.Text = " 导出成功！单击【<a href='../FrmDownLoad.aspx?FileName=GradeSortDataInfo" + this.httpCookie_3.Value + ".csv' target=_blank><font color=red>下载</font></a>】进行保存";
            }
            catch
            {
                ScriptManager.RegisterStartupScript(this.UPPart, this.Page.GetType(), "BExpErrTip", @"alert('导出数据失败！\n\n请将PublicFile目录设置为Everyone用户可修改权限！')", true);
            }
        }

        protected void butQuery_Click(object sender, EventArgs e)
        {
            this.DataGridInfo.PageIndex = 0;
            this.method_0();
        }

        protected void DataGridInfo_PageIndexChanging(object sender, GridViewPageEventArgs e)
        {
            this.DataGridInfo.PageIndex = e.NewPageIndex;
            this.method_0();
        }

        protected void DataGridInfo_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.DataItemIndex == -1)
            {
                this.DataGridInfo.Attributes.Add("oldValue", "#FFFFFF");
                this.DataGridInfo.Attributes.Add("singleValue", "#FFFFFF");
            }
            else
            {
                e.Row.Attributes.Add("onmouseover", "this.bgColor='#F6F5F5'");
                if ((e.Row.DataItemIndex % 2) != 0)
                {
                    e.Row.Attributes.Add("bgcolor", "#FFFFFF");
                    e.Row.Attributes.Add("onmouseout", "this.bgColor=document.getElementById('DataGridInfo').getAttribute('oldValue')");
                }
                else
                {
                    e.Row.Attributes.Add("bgcolor", "#FFFFFF");
                    e.Row.Attributes.Add("onmouseout", "this.bgColor=document.getElementById('DataGridInfo').getAttribute('singleValue')");
                }
            }
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                if (e.Row.Cells[3].Text.Length > 10)
                {
                    e.Row.Cells[3].Text = "<a title=" + e.Row.Cells[3].Text + ">" + e.Row.Cells[3].Text.Substring(0, 10) + "…</a>";
                }
                if (e.Row.Cells[2].Text.Length > Convert.ToInt32(this.ViewState["SubStrLen"].ToString()))
                {
                    e.Row.Cells[2].Text = "<a title=" + e.Row.Cells[2].Text + ">" + e.Row.Cells[2].Text.Substring(0, Convert.ToInt32(this.ViewState["SubStrLen"].ToString())) + "…</a>";
                }
                int num = Convert.ToInt32(e.Row.Cells[5].Text);
                if (!((num >= 0) ? (num <= (Convert.ToInt32(this.DataGridInfo.DataKeys[e.Row.RowIndex]["ExamTime"].ToString()) * 60)) : false))
                {
                    e.Row.Cells[5].Text = Convert.ToString((int) (Convert.ToInt32(this.DataGridInfo.DataKeys[e.Row.RowIndex]["ExamTime"].ToString()) * 60));
                }
                Label label = (Label) e.Row.Cells[7].FindControl("labSort");
                if (!(e.Row.Cells[6].Text.Trim() != ""))
                {
                    this.double_1 = 0.0;
                }
                else
                {
                    this.double_1 = Convert.ToDouble(e.Row.Cells[6].Text.Trim());
                }
                if (this.long_0 != 0L)
                {
                    this.long_0 += 1L;
                    if ((this.ViewState["SumGradeSort"].ToString() == "N") ? !(this.double_0 == this.double_1) : true)
                    {
                        label.Text = Convert.ToString((int) (Convert.ToInt16(this.string_0) + 1));
                        this.string_0 = label.Text.Trim();
                    }
                    else
                    {
                        label.Text = Convert.ToString(this.string_0);
                        this.string_0 = label.Text.Trim();
                    }
                }
                else
                {
                    label.Text = "1";
                    this.string_0 = "1";
                    this.long_0 += 1L;
                }
                this.double_0 = this.double_1;
            }
            if (e.Row.RowType == DataControlRowType.Header)
            {
                string str;
                if (this.ViewState["SortType"].ToString() != " Desc")
                {
                    str = this.ViewState["SortFiled"].ToString();
                    if ((str != null) && (str == "GetCountFen"))
                    {
                        e.Row.Cells[6].Controls.Add(new LiteralControl("↓"));
                    }
                    else
                    {
                        e.Row.Cells[6].Controls.Add(new LiteralControl("↓"));
                    }
                }
                else
                {
                    str = this.ViewState["SortFiled"].ToString();
                    if ((str == null) || (str != "GetCountFen"))
                    {
                        e.Row.Cells[6].Controls.Add(new LiteralControl("↑"));
                    }
                    else
                    {
                        e.Row.Cells[6].Controls.Add(new LiteralControl("↑"));
                    }
                }
            }
        }

        protected void DataGridInfo_Sorting(object sender, GridViewSortEventArgs e)
        {
            string sortExpression = e.SortExpression;
            if (this.ViewState["SortFiled"].ToString() == sortExpression)
            {
                if (!(this.ViewState["SortType"].ToString() == " Desc"))
                {
                    this.ViewState["SortType"] = " Desc";
                }
                else
                {
                    this.ViewState["SortType"] = " ASC";
                }
            }
            else
            {
                this.ViewState["SortFiled"] = e.SortExpression;
            }
            this.method_0();
        }

        protected void DDLDept_SelectedIndexChanged(object sender, EventArgs e)
        {
            this.DataGridInfo.PageIndex = 0;
            this.method_0();
        }

        protected void DDLSubject_SelectedIndexChanged(object sender, EventArgs e)
        {
            this.DataGridInfo.PageIndex = 0;
            this.method_0();
        }

        protected void DDLUPDept_SelectedIndexChanged(object sender, EventArgs e)
        {
            this.DDLDept.Items.Clear();
            this.publicFun_0.LoadDeptInfo(this.DDLDept, this.DDLUPDept.SelectedItem.Value, this.httpCookie_0.Value, "B");
            if (this.DDLDept.Items.Count == 0)
            {
                if (this.DDLUPDept.SelectedItem.Value == "0")
                {
                    ListItem item2 = new ListItem("--所有部门--", "0");
                    this.DDLDept.Items.Insert(0, item2);
                }
                else
                {
                    ListItem item = new ListItem(this.DDLUPDept.SelectedItem.Text, this.DDLUPDept.SelectedItem.Value);
                    this.DDLDept.Items.Add(item);
                }
            }
        }

        private void method_0()
        {
            this.long_0 = 0L;
            this.string_0 = "1";
            this.double_0 = 0.0;
            this.double_1 = 0.0;
            string selectCommandText = "";
            selectCommandText = "select top 20 d.ExamTime,datediff(s,convert(dateTime,a.StartTime),convert(dateTime,a.EndTime)) as ExamUseTime,a.StartTime,a.EndTime,b.UserName,c.DeptName,a.UserCode,a.PaperID,a.ExamName,a.Subject,ROUND(a.GetOldCountFen,2) as GetOldCountFen,ROUND(a.GetCountFen,2) as GetCountFen,Flag=case a.Flag when 'C' then '考试完成' when 'D' then '客观题批改完成' when 'E' then '考试批改完成' when 'G' then '考试异常'  when 'Z' then '作弊标记' end  from ExamUser a,UserInfo b,DeptInfo c,PaperInfo d where d.ID=a.PaperID and a.UserCode=b.UserCode and b.DeptID=c.ID and (a.Flag<>'A' and a.Flag<>'B') ";
            if (!(this.publicFun_0.GetValues("select ParmValue from SysParmInfo where ParmMemo='IsLookTestExam'", "ParmValue").Trim() == "Y"))
            {
                selectCommandText = selectCommandText + " and  a.ExamType='A' ";
            }
            else
            {
                selectCommandText = selectCommandText + " and  (a.ExamType='A' or a.ExamType='C') ";
            }
            if (this.DDLDept.SelectedItem.Value != "0")
            {
                selectCommandText = selectCommandText + " and b.DeptID in (select b.ID from DeptInfo b where " + this.publicFun_0.GetManagDeptID(this.publicFun_0.CheckString(this.DDLDept.SelectedItem.Value)) + ")";
            }
            if (this.DDLSubject.SelectedIndex >= 0)
            {
                if (this.DDLSubject.SelectedItem.Value == "0")
                {
                    ScriptManager.RegisterStartupScript(this.UPPart, this.Page.GetType(), "BChoose", "alert('请选择考试科目信息！')", true);
                }
                selectCommandText = selectCommandText + " and a.Subject like '%" + this.publicFun_0.CheckString(this.DDLSubject.SelectedItem.Text.Replace("│", "").Replace("├", "")) + "%'";
            }
            if (this.txtQuery.Text.Trim() != "")
            {
                selectCommandText = selectCommandText + " and " + this.publicFun_0.CheckString(this.DDLQuery.SelectedItem.Value) + " like '%" + this.publicFun_0.CheckString(this.txtQuery.Text) + "%'";
            }
            if (this.txtStartDate.Text.Trim() != "")
            {
                selectCommandText = selectCommandText + " and Convert(dateTime,a.JoinDate)>=Convert(dateTime,'" + this.publicFun_0.CheckString(this.txtStartDate.Text.Trim()) + " 00:00:00')";
            }
            if (this.txtEndDate.Text.Trim() != "")
            {
                selectCommandText = selectCommandText + " and Convert(dateTime,'" + this.publicFun_0.CheckString(this.txtEndDate.Text.Trim()) + " 23:59:59')>=Convert(dateTime,a.JoinDate)";
            }
            if (this.publicFun_0.GetValues("select ParmValue from SysParmInfo where ParmMemo='ManagGradeType'", "ParmValue").Trim().Trim() == "N")
            {
                if (this.ViewState["ManagPower"].ToString() == "Y")
                {
                    selectCommandText = selectCommandText + " and d.ID<>0 ";
                }
                else if (!(this.ViewState["AddPower"].ToString() == "Y"))
                {
                    selectCommandText = selectCommandText + " and d.ID=0 ";
                }
                else
                {
                    selectCommandText = selectCommandText + " and d.InputUserCode='" + this.httpCookie_0.Value + "'";
                }
            }
            selectCommandText = selectCommandText + "  order by " + this.ViewState["SortFiled"].ToString() + this.ViewState["SortType"].ToString() + ",datediff(s,convert(dateTime,a.StartTime),convert(dateTime,a.EndTime))";
            SqlConnection selectConnection = new SqlConnection(ConfigurationManager.ConnectionStrings["Conn"].ConnectionString);
            SqlDataAdapter adapter = new SqlDataAdapter(selectCommandText, selectConnection);
            DataSet dataSet = new DataSet();
            adapter.Fill(dataSet, "DataInfo");
            this.DataGridInfo.DataSource = dataSet.Tables["DataInfo"].DefaultView;
            this.DataGridInfo.DataBind();
            adapter.Dispose();
            selectConnection.Close();
            selectConnection.Dispose();
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            this.httpCookie_0 = new HttpCookie("ExamUserCode");
            this.httpCookie_0 = base.Request.Cookies["ExamUserCode"];
            this.httpCookie_1 = new HttpCookie("ExamUserName");
            this.httpCookie_1 = base.Request.Cookies["ExamUserName"];
            this.httpCookie_2 = new HttpCookie("ExamUserLevel");
            this.httpCookie_2 = base.Request.Cookies["ExamUserLevel"];
            this.httpCookie_3 = new HttpCookie("ExamDeptID");
            this.httpCookie_3 = base.Request.Cookies["ExamDeptID"];
            if ((this.httpCookie_0 != null) && (this.httpCookie_0.Value != ""))
            {
                base.Response.Cache.SetCacheability(HttpCacheability.NoCache);
                base.Response.Cache.SetNoStore();
                this.httpCookie_0.Value = this.publicFun_0.CheckString(base.Server.UrlDecode(this.httpCookie_0.Value));
                this.httpCookie_1.Value = this.publicFun_0.CheckString(base.Server.UrlDecode(this.httpCookie_1.Value));
                this.httpCookie_2.Value = this.publicFun_0.CheckString(base.Server.UrlDecode(this.httpCookie_2.Value));
                this.httpCookie_3.Value = this.publicFun_0.CheckString(base.Server.UrlDecode(this.httpCookie_3.Value));
                if (!base.IsPostBack)
                {
                    if (this.publicFun_0.ReturnPaperData() != "Yes")
                    {
                        ScriptManager.RegisterStartupScript(this.UPPart, this.Page.GetType(), "BCheck", "alert('此版本暂未授权,请拔打(0)13870606104手机号进行授权！')", true);
                    }
                    else if (this.httpCookie_2.Value != "A")
                    {
                        this.txtQuery.Attributes.Add("onkeydown", "SubmitKeyClick('butQuery');");
                        this.ViewState["SortFiled"] = "GetCountFen";
                        this.ViewState["SortType"] = " Desc";
                        this.DDLUPDept.DataTextField = "DeptName";
                        this.DDLUPDept.DataValueField = "ID";
                        if (!(this.httpCookie_2.Value == "C"))
                        {
                            this.DDLUPDept.DataSource = this.publicFun_0.RetrunDataView("select ID,DeptName from DeptInfo where ID=" + this.httpCookie_3.Value + " order by SortInfo,ID");
                        }
                        else
                        {
                            this.DDLUPDept.DataSource = this.publicFun_0.RetrunDataView("select ID,DeptName from DeptInfo where UPID=0  order by SortInfo,ID");
                        }
                        this.DDLUPDept.DataBind();
                        if (!(this.httpCookie_2.Value == "C"))
                        {
                            this.DDLDept.Items.Clear();
                            this.publicFun_0.LoadDeptInfo(this.DDLDept, this.DDLUPDept.SelectedItem.Value, this.httpCookie_0.Value, "B");
                            if (this.DDLDept.Items.Count == 0)
                            {
                                ListItem item = new ListItem(this.DDLUPDept.SelectedItem.Text, this.DDLUPDept.SelectedItem.Value);
                                this.DDLDept.Items.Add(item);
                            }
                        }
                        else
                        {
                            this.DDLUPDept.SelectedIndex = -1;
                            this.DDLDept.SelectedIndex = -1;
                            ListItem item2 = new ListItem("--所有单位--", "0");
                            ListItem item3 = new ListItem("--所有部门--", "0");
                            this.DDLDept.Items.Insert(0, item3);
                            this.DDLUPDept.Items.Insert(0, item2);
                        }
                        this.publicFun_0.LoadSubjectInfo(this.DDLSubject, this.httpCookie_0.Value, "N", "B", this.httpCookie_3.Value);
                        this.DDLSubject.Items.Insert(0, new ListItem("--请选择科目信息--", "0"));
                        string str2 = this.publicFun_0.GetValues("select ParmValue from SysParmInfo where ParmMemo='SumGradeSort'", "ParmValue").Trim();
                        if (str2.Trim() == "")
                        {
                            str2 = "Y";
                        }
                        this.ViewState["SumGradeSort"] = str2;
                        SqlConnection connection = new SqlConnection(ConfigurationManager.ConnectionStrings["Conn"].ConnectionString);
                        connection.Open();
                        SqlCommand command = new SqlCommand("select AddPaper,ManagPaper from UserPower where UserCode='" + this.httpCookie_0.Value + "'", connection);
                        SqlDataReader reader = command.ExecuteReader(CommandBehavior.CloseConnection);
                        if (reader.Read())
                        {
                            this.ViewState["AddPower"] = reader["AddPaper"].ToString();
                            this.ViewState["ManagPower"] = reader["ManagPaper"].ToString();
                        }
                        reader.Close();
                        command.Dispose();
                        connection.Close();
                        connection.Dispose();
                        string str = this.publicFun_0.GetValues("select ParmValue from SysParmInfo where ParmMemo='SubStrLength'", "ParmValue").Trim();
                        if (str.Trim() == "")
                        {
                            str = "20";
                        }
                        this.ViewState["SubStrLen"] = str;
                        this.method_0();
                    }
                    else
                    {
                        ScriptManager.RegisterStartupScript(this.UPPart, this.Page.GetType(), "BCheckA", "alert('成绩查询权限未开放！')", true);
                    }
                }
            }
            else
            {
                base.Response.Write("<script language=javascript>top.location.href='../Index.htm';self.close();</script>");
            }
        }
    }
}

